import $ from "jquery";

export let getInfor = options => {
  return $.get(`${window.GlobalData.api.setting.getInfor}/id/${options.id}`)
};

export let addInfor = options => {
  return $.post(window.GlobalData.api.setting.addInfor,options)
};

export let getlist = options =>{
  return $.get(`${window.GlobalData.api.setting.getlist}/id/${options.id}/?p=${options.page}`)
};

export let deleteItem = options => {
    return $.get(`${window.GlobalData.api.setting.deleteItem}/pid/${options.pid}/id/${options.id}`)
};

export let getEditAllList = (options) => {
   return $.when($.post(window.GlobalData.api.setting.getAllList,options),$.get(`${window.GlobalData.api.setting.getSelectList}/uid/${options.uid}`))
};

export  let getEditSelectList = options => {
  return $.get(`${window.GlobalData.api.setting.getSelectList}/uid/${options.uid}`)
};

export  let uploadSelectedlist = items => {
    return $.get(`${window.GlobalData.api.setting.updateList}/uid/${items.uid}/goods_id/${items.goods_id}`);
};

export let getKouling = options =>{
  return $.get(`${window.GlobalData.api.setting.getKouling}`)
};

export let searchWord = options =>{
  return $.get(`${window.GlobalData.api.setting.searchWord}/uid/${options.uid}/name/${options.text}/goods_cate/${options.cate}/p/${options.page}`)
};

export let EditAgentinfo = options =>{
  return $.get(`${window.GlobalData.api.setting.editAgentinfo}id/${options.id}/business_user/${options.user}/business_mobile/${options.phone}`)
};

export let getAgentinfo = options =>{
  return $.get(`${window.GlobalData.api.setting.getAgentinfo}${options.id}`)
};
